<!DOCTYPE html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>待接受列表</title>
		<!-- css代码 start -->
		<link href="../../../css/mui.min.css" rel="stylesheet" />
		<link href="../../../css/global.css" rel="stylesheet" />
		<link href="../../../css/style.css" rel="stylesheet" />
		<link href="../../../css/task.css" rel="stylesheet" />
		<style>
			.item_box .item .text{
				margin: 5px auto;
			}
			.item_box .item .text span.cen{
				margin-left:0;
			}
			.item_box .item .text span{
				width: auto;
			}
		</style>
		<!-- css代码 end -->
	</head>
	<body>

		<!-- html代码 start -->
		<!-- <div class="send_logo">
			<img src="../../../images/send_logo.png" width="100%">
		</div> -->
		<!-- html代码 start -->
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">待接受列表</h1>
		</header>
		<div style="height: 30px;"></div>
		<div class="mui-content m">
			<div class="details_con" style="margin: 0;">
				<div class="item_box" id="neirong">
				</div>
			</div>
		</div>
		<!-- html代码 end -->

		<!-- js代码 start -->

		<!-- 基础js start -->
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/utils/h.js"></script>
		<script src="../../../js/constant.js"></script>
		<script src="../../../js/common.js"></script>
		<script src="../../../js/utils/base64.js"></script>
		<script src="../../../js/utils/md5.js"></script>
		<script src="../../../js/utils/sortMap.js"></script>
		<script src="../../../js/utils/http.js"></script>
		<script src="../../../js/app.js"></script>
		<!-- 基础js end -->

		<script type="text/javascript" charset="utf-8">
			// 页面跳转方法
			function tiaozhuan(ServiceNoticeId,serviceNo,planId,planState,subServiceType,isCheck){
				console.log("ServiceNoticeId:"+ServiceNoticeId+"	serviceNo:"+serviceNo+"	planId:"+planId+"	planState:"+planState+"		isCheck:"+isCheck)
				app.jumpTo("/view/service/accept/details.html", "view/service/accept/details.html",
				{
					ServiceNoticeId:ServiceNoticeId,
					serviceNo: serviceNo,
					planId: planId
				});
			}
			
			// 获取列表的方法
			function getList(){
				app.showWaiting('加载中...')
				ajaxGet(BASE_URL + "cc/notice/getMyServiceNotice", {
					"EnginnerId": app.getUser().enginnerId,
					"state": "0"
				}, function(data) {
					app.closeWaiting()
					if (data.code == 200) {
						h("#neirong").html("");
						var html = "";
						if(data.data && data.data.length > 0){
							for(var i=0;i<data.data.length;i++){
								/* var xianshi = '';
								var enginnerType = data.data[i].enginnerType==undefined?"":data.data[i].enginnerType;
								var isVip = data.data[i].isVip==undefined?"":data.data[i].isVip;
								var userIsdpel = data.data[i].userIsdpel==undefined?"":data.data[i].userIsdpel;
								
								if(userIsdpel=='1'){
									xianshi = ''
								}
								if(isVip!=''){
									xianshi += isVip
								}else{
									if(enginnerType!=''){
										xianshi += enginnerType
									}
								} */
								
								var enginnerType = data.data[i].enginnerType ? data.data[i].enginnerType : "";
								var hopeBusinessHours = data.data[i].hopeBusinessHours ? data.data[i].hopeBusinessHours : "";
								html += '<div class="item" onclick="tiaozhuan(\''+data.data[i].id+'\',\''+data.data[i].serviceNo+'\',\''+data.data[i].planId+'\',\''+data.data[i].planState+'\',\''+data.data[i].subServiceType+'\',\''+data.data[i].isCheck+'\')">';
								html += '<div class="bar">';
								html += '<span class="number"><img src="../../../images/icon_204.png" />'+data.data[i].serviceNo+'</span>';		
								html += '<span class="vip">'+enginnerType+'</span>';
								html += '</div>';
								html += '<div class="text autoHeight">';
								html += '<span class="cen" style="color: #333;">'+data.data[i].customerName+'</span>';
								html += '</div>';
								html += '<div class="type">';
								html += '<p><img src="../../../images/icon_202.png"/><span class="lpl">提交时间：</span><span>'+data.data[i].createTime+'</span></p>';
								html += '<p><img src="../../../images/icon_203.png"/><span class="lpl">服务子类型：</span><span>'+data.data[i].subServiceType+'</span></p>';
								html += '<p><img src="../../../images/icon_202.png"/><span class="lpl">期望服务时间：</span><span>'+hopeBusinessHours+'</span></p>';
								html += '</div>';
								html += '</div>';
								
							}
							h("#neirong").html(html);
						}else{
							html = '<div class="nodata">—— 暂无数据 ——</div>';
							h("#neirong").html(html);
						}
					} else {
						var html = '<div class="nodata">—— 暂无数据 ——</div>';
						h("#neirong").html(html);
						app.toast(data.msg);	
					}
				}, function(errorMsg) {
					app.closeWaiting();
					var html = '<div class="nodata">—— 暂无数据 ——</div>';
					h("#neirong").html(html);
					app.toast("数据获取失败，请检查网络连接");				
				});
			}
			
			(function($, doc) {
				$.init();

				$.plusReady(function() {
					// 调用获取列表的方法
					getList()
					h('.mui-action-back').tap(function () {
						var indexTl=plus.webview.getWebviewById('view/main/indexTL.html');
						if(indexTl){
							indexTl.evalJS('getMyTeamCount()')
						}
					})
				});

			}(mui, document));


		</script>
		<!-- js代码 end -->
	</body>
</html>
